#include <bits/stdc++.h>
#define _for(i, a, b)  for (int i = (a); i <= (b); i ++ )
#define ll long long
using namespace std;
const int N = 3e5 + 5;
int n, k, q, a[N]; ll ans;
struct BIT {
	int tr[N];
	inline int lowbit(int x) { return (x & ( - x)); }
	inline void update(int x) { for (int i = x; i <= n; i += lowbit(i))  tr[i] ++ ; }
	inline int query(int x) {
		int res = 0;
		for (int i = x; i; i -= lowbit(i))  res += tr[i]; return res;
	} inline int query(int l, int r) { return l <= r ? query(r) - query(l - 1) : 0; }
} BIT;
int main() {
	freopen("random.in", "r", stdin), freopen("random.out", "w", stdout);
	ios :: sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n >> k >> q;
	_for (i, 1, n)  cin >> a[i], ans += BIT.query(a[i] + 1, n), BIT.update(a[i]);
	return cout << ans << "\n", 0;
}

